package com.class05.service.impl;

import com.class05.dao.impl.StudentDaoImpl;
import com.class05.pojo.Student;
import com.class05.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDaoImpl studentDao;
    public void setStudentDao(StudentDaoImpl studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public List<Student> findAll() {
        List<Student> studentList = studentDao.findAll();
        System.out.println("业务层调用持久化层的方法，完成数据的查询数据为："
                + studentList );
        return studentList;
    }

    @Override
    public int addStudent(Student student) {
       return studentDao.addStudent(student);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public int deleteStudent(Integer id) {
        return studentDao.deleteStudent(id);
    }
}
